package com.ilearn.iodata.iolingo.str;

import org.junit.Test;

public class HttpPath {

    private String URI = "ctrl";

    @Test
    public void testIndex() {
        String http = "http://loalhost:8081/ctrl/$metadata";
        int i = http.indexOf(URI);

        System.out.println("pos:" + i);

        String odataUrl = http.substring(http.indexOf(URI) + URI.length());

        System.out.println("odataUrl:" + odataUrl);

        String baseUrl = http.substring(0, i + URI.length());

        System.out.println("baseUrl:" + baseUrl);

        System.out.println("baseUrl2:" + http.substring(0, http.indexOf(odataUrl)));


    }
}
